package wang.yangziqing.app_kotlin.ui.activity

import android.support.v4.view.ViewCompat
import android.support.v4.view.ViewPropertyAnimatorListener
import android.view.View
import kotlinx.android.synthetic.main.activity_splash.*


import wang.yangziqing.app_kotlin.R
import wang.yangziqing.app_kotlin.base.BaseActivity

/**
 * Created by Administrator on 2017/11/29.
 */
class SplashActivity : BaseActivity(), ViewPropertyAnimatorListener {

    /**
     * 返回布局id
     */
    override fun getLayoutId(): Int {
        return R.layout.activity_splash
    }

    override fun initData() {
        //缩放动画
        ViewCompat.animate(imageView)
                .scaleX(1.0f)
                .scaleY(1.0f)
                .setDuration(2000)
                .setListener(this)//动画结束的监听
    }
    override fun onAnimationCancel(view: View?) {
    }

    override fun onAnimationStart(view: View?) {
    }

    override fun onAnimationEnd(view: View?) {
//动画结束 需要跳转到主界面 如果是在正式的app中需要判断是不是进入引导界面
        startActivityAndFinishMyself<MainActivity>()
    }


}